package org.redemptionhost.service;

import java.util.List;

import javax.jdo.PersistenceManager;
import javax.jdo.Query;

import org.redemptionhost.HostQueries;
import org.redemptionhost.jdo.JdoQueries;
import org.redemptionhost.model.Greeting;
import org.redemptionhost.model.Host;

import com.google.inject.Inject;
import com.google.inject.Provider;

public class JdoHostQueries extends JdoQueries<Host> implements HostQueries {
    @Inject
    public JdoHostQueries(Provider<PersistenceManager> pmProvider)
    {
        super(Host.class, pmProvider);
    }
	@Override
	public List<Host> all() {
        Query query = newQuery();
        query.setOrdering("lastName ascending, firstName ascending");
        return toList(query.execute());
	}

}
